#coding=utf-8
__author__ = 'rsg'


def decorator1(method):
    def wrapper(self):
        print 'a={0}, b={1}'.format(self.a, self.b)
        method(self)
        return
    return wrapper


def decorator2(method):
    def wrapper(self):
        def minor(self):
            m = self.a - self.b
            print 'm='+str(m)
            return
        minor(self)
        method(self)
        return
    return wrapper


class Calculate(object):

    def __init__(self, a, b):
        self.a = a
        self.b = b

    @decorator1
    @decorator2
    def sum(self):
        s = self.a + self.b
        #m = minor(self.a, self.b)
        print 's='+str(s)

a = Calculate(1, 2)
a.sum()